﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MadProps
{
    public static class ExtensionMethods
    {
        public static bool Is(this IHavePropId first, IHavePropId second)
        {
            if (first == null || second == null)
            {
                return false;
            }
            return first.PropId == second.PropId;
        }

        public static bool IsAny(this IHavePropId first, params IHavePropId[] others)
        {
            return IsAny(first, ((IEnumerable<IHavePropId>)others));
        }

        public static bool IsAny(this IHavePropId first, IEnumerable<IHavePropId> others)
        {
            return others.Any(o => first.Is(o));
        }
    }
}
